#ifndef _UTILS_BASE64_H_
#define _UTILS_BASE64_H_
#ifdef __cplusplus
extern "C"
{
#endif

    /**
     * @brief 对数据base64编码
     *
     * @param in Source data
     * @param in_len Source data length
     * @param out Encoded data
     * @return unsigned int Encoded data length
     */
    extern unsigned int utils_b64_encode(const unsigned char *in, unsigned int in_len, unsigned char *out);

    /**
     * @brief 对数据base64解码
     *
     * @param in Source data
     * @param in_len Source data length
     * @param out Decoded data
     * @return unsigned int Decoded data length
     */
    extern unsigned int utils_b64_decode(const unsigned char *in, unsigned int in_len, unsigned char *out);

    /**
     * @brief 对文件base64编码
     *
     * @param in_file_path Source file
     * @param out_file_path Encoded file
     * @return unsigned int Encoded file length
     */
    extern unsigned int utils_b64_encode_file(const char *in_file_path, char *out_file_path);

    /**
     * @brief 对文件base64解码
     *
     * @param in_file_path Source file
     * @param out_file_path Decoded file
     * @return unsigned int Decoded file length
     */
    extern unsigned int uitls_b64_decode_file(const char *in_file_path, char *out_file_path);

#ifdef __cplusplus
}
#endif
#endif //_UTILS_BASE64_H_
